import request from "@/utils/request";


/**
 * 获取新闻列表
 * @returns {*}
 */
export const getNewsByParams = (data) => {
	return request({
		url: "/app/news/getNewsByParams",
		method: "POST",
		data
	})
}

/**
 * 进行添加新闻
 * @param data
 * @returns {*}
 */
export const addNews = (data) => {
	return request({
		url: "/app/news",
		method: 'POST',
		data
	})
}

export const editNews = (data) => {
	return request({
		url: "/app/news",
		method: 'PUT',
		data
	})
}

export const delNews = (newsId) => {
	return request({
		url: `/app/news/${newsId}`,
		method: 'DELETE',
	})
}
